Recursion depth exceeding in a python function for counting reverse pairs

join shbcf.ru